import request from '@/request/index.js';

export function getAppointmentDepartment(params) {
	return request.get({
		url: '/app-api/hospital/appointment/get-department',
		params,
		custom: {
			title: "查询预约挂号科室",
			authentication: true
		}
	});
}

export function getAppointmentDoctorList(params) {
	return request.get({
		url: '/app-api/hospital/appointment/get-doctor-list',
		params,
		custom: {
			title: "查询挂号预约医生",
			authentication: true
		}
	});
}
export function getAppointmentToDay(params) {
	return request.get({
		url: '/app-api/hospital/appointment/get-today-log',
		params,
		custom: {
			title: "查询当日",
			authentication: true
		}
	});
}

export function selfCancel(id) {
	return request.get({
		url: '/app-api/hospital/appointment/self-cancel',
		params:{id:id},
		custom: {
			title: "当日挂号退号",
			authentication: true
		}
	});
}

export function getAppointmentDoctorListNew(data) {
	return request.post({
		url: '/app-api/hospital/appointment/get-doctor-list-new',
		data,
		custom: {
			title: "查询挂号预约医生新版带排班",
			authentication: true
		}
	});
}


export function getAppointmentDepartmentScheduling(params) {
	return request.get({
		url: '/app-api/hospital/appointment/get-department-scheduling',
		params,
		custom: {
			title: "查询科室排班",
			authentication: true
		}
	});
}

export function getAppointmentNumberData(params) {
	return request.get({
		url: '/app-api/hospital/appointment/get-number-data',
		params,
		custom: {
			title: "查询号源",
			authentication: true
		}
	});
}

export function appointmentSubmit(data) {
	return request.post({
		url: '/app-api/hospital/appointment/submit',
		data,
		custom: {
			title: "提交挂号",
			authentication: true
		}
	});
}
export function appointmentSelfSubmit(data) {
	return request.post({
		url: '/app-api/hospital/appointment/self-submit',
		data,
		custom: {
			title: "当日提交挂号",
			authentication: true
		}
	});
}
export function getAppointment(id) {
	return request.get({
		url: '/app-api/hospital/appointment/get?id='+id,
		custom: {
			title: "提交挂号",
			authentication: true
		}
	});
}
export function getAppointmentPage(params) {
	return request.get({
		url: '/app-api/hospital/appointment/page',
		params,
		custom: {
			title: "我的预约未支付",
			authentication: true
		}
	});
}

export function getAppointmentPayPage(params) {
	return request.get({
		url: '/app-api/hospital/appointment/page-pay',
		params,
		custom: {
			title: "我的预约已支付",
			authentication: true
		}
	});
}

export function getAppointmentHisPage(params) {
	return request.get({
		url: '/app-api/hospital/appointment/page-his',
		params,
		custom: {
			title: "我的预约His",
			authentication: true
		}
	});
}

export function payAppointment(params) {
	return request.get({
		url: '/app-api/hospital/appointment/pay',
		params,
		custom: {
			title: "支付挂号",
			authentication: true
		}
	});
}
export function cancelAppointment(params) {
	return request.get({
		url: '/app-api/hospital/appointment/cancel',
		params,
		custom: {
			title: "取消挂号",
			authentication: true
		}
	});
}

export function getDepartmentByCode(params) {
	return request.get({
		url: '/app-api/hospital/department/get',
		params,
		custom: {
			title: "获取科室根据code",
			authentication: true
		}
	});
}